<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    // const selectParams = {
    //   more: '',
    //   rentType: undefined,
    //   price: undefined,
    //   undefined: undefined
    // }
    const selectParams = {
      more: '',
      rentType: undefined,
      price: undefined,
      undefined: undefined
    }

    console.log('selectParams', selectParams);
    // 写法1：
    // for (const key in selectParams) {
    //   console.log(1, 'key', key);
    //   console.log(2, 'value', selectParams[key]);
    //   console.log('--------------');
    // }

    // ["more", "rentType", "price", "undefined"]
    // 写法2:
    Object.keys(selectParams).forEach((key, index) => {
      console.log(index, key, selectParams[key]);
    });




  </script>
</body>

</html>